package com.example.demo.dao;

import com.example.demo.entity.StudentBean;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
/*报错二：忘记写注解@mapper,直接报错：
Field studentDao in com.example.demo.service
.impl.StudentServiceImpl required a bean of
 type 'com.example.demo.dao.StudentDao' that could not be found.*/
@Mapper
public interface StudentDao {

    List<StudentBean> getAll();

    Integer insert(StudentBean studentBean);

    Integer edit(StudentBean studentBean);

    Integer del(Integer id);

    StudentBean getOne(Integer id);


    StudentBean getByName(String name);

    List<StudentBean> getPage(
            @Param("jump") Integer jump,
            @Param("pageSize") Integer pageSize,
            @Param("address") String address,
            @Param("name") String name,
            @Param("sortOrder") String sortOrder
    );

    Integer getCount(
            @Param("address") String address,
            @Param("name") String name
    );


}
